-
Notifications
You must be signed in to change notification settings - Fork 2.6k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
credential-cache: handle ECONNREFUSED gracefully #5329
credential-cache: handle ECONNREFUSED gracefully #5329
Conversation
ff41d09
to
1059d6f
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
To distinguish the two identical error messages "unable to connect to cache daemon", consider changing the second to “unable to connect to spawned cache daemon”
de3a367
to
42da5df
Compare
Turns out, the existing tests would've caught this issue, if I hadn't unintentionally sabotaged them |
@dscho Might this be fixed in 2.48 or will it have to wait for 2.49? |
Thanks for reminding me; I had meant to include this in -rc1 but got overwhelmed with the amount of work required to rebase Git for Windows from -rc0 to -rc1 and have it build and pass the tests |
42da5df
to
7db4028
Compare
Range-diff after I rebased onto -rc1
|
We map WSAGetLastError() errors to errno errors in winsock_error_to_errno(), but the MSVC strerror() implementation only produces "Unknown error" for most of them. Produce some more meaningful error messages in these cases. Our builds for ARM64 link against the newer UCRT strerror() that does know these errors, so we won't change the strerror() used there. The wording of the messages is copied from glibc strerror() messages. Reported-by: M Hickford <[email protected]> Signed-off-by: Matthias Aßhauer <[email protected]> Signed-off-by: Johannes Schindelin <[email protected]>
The part about keeping the original error number hasn't been accurate since commit c11f75c (mingw: make sure errno is set correctly when socket operations fail, 2019-11-25) and the part about strerror() not knowing about these errors is untrue since the previous commit. Signed-off-by: Matthias Aßhauer <[email protected]> Signed-off-by: Johannes Schindelin <[email protected]>
Commit 2406bf5 (Win32: detect unix socket support at runtime, 2024-04-03) introduced a runtime detection for whether the operating system supports unix sockets for Windows, but a mistake snuck into the tests. When building and testing Git without NO_UNIX_SOCKETS we currently skip t0301-credential-cache on Windows if unix sockets are supported and run the tests if they aren't. Flip that logic to actually work the way it was intended. Signed-off-by: Matthias Aßhauer <[email protected]> Signed-off-by: Johannes Schindelin <[email protected]>
In 245670c (credential-cache: check for windows specific errors, 2021-09-14) we concluded that on Windows we would always encounter ENETDOWN where we would expect ECONNREFUSED on POSIX systems, when connecting to unix sockets. As reported in [1], we do encounter ECONNREFUSED on Windows if the socket file doesn't exist, but the containing directory does and ENETDOWN if neither exists. We should handle this case like we do on non-windows systems. [1] git-for-windows#4762 (comment) This fixes git-for-windows#5314 Helped-by: M Hickford <[email protected]> Signed-off-by: Matthias Aßhauer <[email protected]> Signed-off-by: Johannes Schindelin <[email protected]>
7db4028
to
9a70050
Compare
Oops
|
/add relnote bug When using the The workflow run was started |
When using the `cache` credential helper, it could error out with "fatal: unable to connect to cache daemon: Unknown error" under certain circumstances; This [was fixed](git-for-windows/git#5329). Signed-off-by: gitforwindowshelper[bot] <[email protected]>
I should probably add some tests for this.
I should probably add some tests for this.
I should probably add some tests for this.
I should probably add some tests for this.
I should probably add some tests for this.
I should probably add some tests for this.
I should probably add some tests for this.
I should probably add some tests for this.
I should probably add some tests for this.
I should probably add some tests for this.